import SwiftUI
import WidgetKit
import AppIntents

@available(iOS 16.0, *)
struct NextWeekIntent: AppIntent {
    static var title: LocalizedStringResource = "Next Week"
    func perform() async throws -> some IntentResult {
        DateStorge.shared.nextWeek()
        return .result()
    }
}

@available(iOS 16.0, *)
struct LastWeekIntent: AppIntent {
    static var title: LocalizedStringResource = "Last Week"
    func perform() async throws -> some IntentResult {
        DateStorge.shared.lastWeek()
        return .result()
    }
}

@available(iOS 16.0, *)
struct NextMonthIntent: AppIntent {
    static var title: LocalizedStringResource = "Next Month"
    func perform() async throws -> some IntentResult {
        DateStorge.shared.nextMonth()
        return .result()
    }
}

@available(iOS 16.0, *)
struct LastMonthIntent: AppIntent {
    static var title: LocalizedStringResource = "Last Month"
    func perform() async throws -> some IntentResult {
        DateStorge.shared.lastMonth()
        return .result()
    }
}

@available(iOS 16.0, *)
struct TodayIntent: AppIntent {
    static var title: LocalizedStringResource = "Today"
    func perform() async throws -> some IntentResult {
        DateStorge.shared.today()
        return .result()
    }
}
